Skip to content

added cross-account OSS bucket configuration #22632

Open
wildpcww wants to merge 7 commits intopingcap:release-8.5from
wildpcww:br-ali-audit-log
Open

added cross-account OSS bucket configuration #22632
wildpcww wants to merge 7 commits intopingcap:release-8.5from
wildpcww:br-ali-audit-log

Conversation

@wildpcww
Copy link
Collaborator

First-time contributors' checklist

What is changed, added or deleted? (Required)

  • Add documentation for cross-account OSS bucket configuration when the OSS bucket and RAM role are in different Alibaba Cloud accounts
  • Includes RAM Policy and Bucket Policy configuration examples

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

wildpcww and others added 7 commits March 23, 2026 18:24
- Add manual backup feature with key characteristics and creation steps
- Update PITR window to 7 days for premium instances
- Fix Premium naming consistency using {{{ .premium }}} variable
- Remove manual backup limitation note since it's now supported

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Aolin <aolinz@outlook.com>
…dit logging

Added documentation for configuring OSS bucket and RAM role when they are in different cloud accounts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 25, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign icemap for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. missing-translation-status This PR does not have translation status info. labels Mar 25, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the TiDB Cloud documentation by providing detailed instructions for configuring Alibaba Cloud OSS buckets for audit log storage in a cross-account scenario. This addresses a common enterprise use case where resources might be distributed across different cloud accounts, ensuring that audit logs can be securely stored and accessed even when the storage bucket and the accessing role reside in separate Alibaba Cloud accounts. The changes clarify the necessary RAM and Bucket policy configurations to facilitate this secure cross-account data flow.

Highlights

  • Cross-Account OSS Bucket Configuration: Added comprehensive documentation for configuring Alibaba Cloud OSS buckets for audit log storage in cross-account scenarios, specifically when the OSS bucket and the RAM role are in different Alibaba Cloud accounts.
  • Policy Examples: Included detailed examples for both RAM Policy and Bucket Policy configurations required to enable cross-account access for audit logs.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for configuring cross-account OSS bucket access for audit logs. The review suggests improvements to technical accuracy, such as correcting the bucket policy's Action from oss:GetObject to oss:PutObject and updating the Principal format. It also recommends enhancing clarity by explicitly defining account roles, using more descriptive placeholders, and providing clear replacement instructions. Additionally, the review advises adhering to the style guide by using sentence case for headings and formatting configuration parts as a numbered list.

Comment on lines +181 to +222
**Cross-Account OSS Bucket Configuration**

If the OSS bucket storing the audit logs and the role accessing the OSS bucket are in different cloud accounts, the configuration process is slightly different.

**1. RAM Policy Configuration**
When creating the RAM policy, you need to add the information of User Account 2 in the Resource field. Define the policy using the following JSON script:

```json
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": "oss:PutObject",
"Resource": "acs:oss:oss-<region>:<User Account 2>:<bucket-name>/*"
}
]
}
```

**2. Bucket Policy Configuration**
In addition, you also need to configure a Bucket Policy on the destination OSS bucket to allow the assumed role from the different account to access it. Use the following configuration:

```json
{
"Version": "1",
"Statement": [
{
"Action": [
"oss:GetObject"
],
"Effect": "Allow",
"Principal": [
"arn:sts::<User Account 1>:assumed-role/<role-name>/*"
],
"Resource": [
"acs:oss:*:<User Account 2>:<bucket-name>/*"
]
}
]
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Hello! As a senior technical writer, I've reviewed this section and have a suggestion to improve its technical accuracy, clarity, and adherence to our documentation style guide.

Here's a summary of the proposed changes:

  • Technical Accuracy:

    • The bucket policy's Action has been corrected from oss:GetObject to oss:PutObject, which is required for TiDB Cloud to write audit logs. This is to ensure technical accuracy as per the style guide.
    • The Principal in the bucket policy has been updated to use the correct format for an Alibaba Cloud RAM role, as the previous format appeared to be for AWS.
  • Clarity and Readability:

    • The guide now explicitly defines which account holds which resource to avoid ambiguity.
    • Placeholders like <User Account 1> have been replaced with more descriptive ones like <role-account-id>.
    • Added clear instructions on what to replace the placeholders with.
  • Style and Formatting:

    • The heading is now in sentence case and uses a standard heading level (#####) for better document structure.
    • The two configuration parts are now presented as a numbered list of steps.

I've provided a ready-to-commit suggestion that incorporates all these improvements. Thank you for your contribution!

##### Cross-account OSS bucket configuration

If your OSS bucket and RAM role are in different Alibaba Cloud accounts, you need to perform additional configurations for cross-account access. For the purpose of this guide, assume that the RAM role for TiDB Cloud is in `Account 1` and the OSS bucket is in `Account 2`.

1.  **Configure the RAM policy in `Account 1`**

    When you create the RAM policy for the role in `Account 1`, you need to specify the bucket in `Account 2` as the resource. Use the following policy:

    ```json
    {
      "Version": "1",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "oss:PutObject",
          "Resource": "acs:oss:oss-<region>:<bucket-account-id>:<bucket-name>/*"
        }
      ]
    }
    ```

    In the policy, replace `<bucket-account-id>` with the ID of `Account 2`.

2.  **Configure the bucket policy in `Account 2`**

    In `Account 2`, you also need to configure a bucket policy on the destination OSS bucket to grant the RAM role from `Account 1` permission to write objects. Use the following policy:

    ```json
    {
        "Version": "1",
        "Statement": [
            {
                "Action": "oss:PutObject",
                "Effect": "Allow",
                "Principal": {
                    "RAM": [
                        "acs:ram::<role-account-id>:role/<role-name>"
                    ]
                },
                "Resource": "acs:oss:*:<bucket-account-id>:<bucket-name>/*"
            }
        ]
    }
    ```

    In the policy, make the following replacements:
    - Replace `<role-account-id>` with the ID of `Account 1`.
    - Replace `<role-name>` with the name of the RAM role you created in `Account 1`.
    - Replace `<bucket-account-id>` with the ID of `Account 2`.
References
  1. The suggested changes improve technical accuracy, clarity, and readability, as outlined in lines 14 and 16 of the repository's style guide. (link)
  2. The heading has been changed to sentence case to follow the style guide (line 32). (link)
  3. The configuration parts have been formatted as an ordered list for steps, as recommended by the style guide (line 33). (link)

@ti-chi-bot
Copy link

ti-chi-bot bot commented Mar 25, 2026

@wildpcww: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify 120659c link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@lilin90 lilin90 requested a review from hfxsd March 25, 2026 08:18
@lilin90 lilin90 added the translation/no-need No need to translate this PR. label Mar 25, 2026
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Mar 25, 2026
@lilin90 lilin90 added missing-translation-status This PR does not have translation status info. area/tidb-cloud This PR relates to the area of TiDB Cloud. nextgen Indicates that the Issue or PR belongs to the nextgen kernel architecture. and removed missing-translation-status This PR does not have translation status info. labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tidb-cloud This PR relates to the area of TiDB Cloud. contribution This PR is from a community contributor. nextgen Indicates that the Issue or PR belongs to the nextgen kernel architecture. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants